package com.kingdee.pda;

import com.example.basecommon.http.rxjava.BaseResponse;
import com.kingdee.pda.entity.CheckOrderDetailBean;
import com.kingdee.pda.entity.CheckOrderListBean;
import com.kingdee.pda.entity.ConfigQueryResponceBean;
import com.kingdee.pda.entity.FastAllotRequestBean;
import com.kingdee.pda.entity.FastAllotTaskResquestBean;
import com.kingdee.pda.entity.Goods;
import com.kingdee.pda.entity.InvstatusBean;
import com.kingdee.pda.entity.LocationBalanceRes;
import com.kingdee.pda.entity.LoginResponseBean;
import com.kingdee.pda.entity.OrderSubmitBean;
import com.kingdee.pda.entity.OutCheckRequestBean;
import com.kingdee.pda.entity.PriorityBean;
import com.kingdee.pda.entity.ProductOwnerBean;
import com.kingdee.pda.entity.ReplenishCommitBean;
import com.kingdee.pda.entity.ReplenishOrderBean;
import com.kingdee.pda.entity.ReplenishOrderDetailBean;
import com.kingdee.pda.entity.ScanOutOrderInfoBean;
import com.kingdee.pda.entity.ScanSnResponsebean;
import com.kingdee.pda.entity.SkuBindLocationsBean;
import com.kingdee.pda.entity.Warehouse;
import com.kingdee.pda.entity.WarehouseAreaLocationInfo;
import com.kingdee.pda.entity.WarehouseLocation;
import com.kingdee.pda.ui.interception_registr.InterceptionOrderBean;
import com.kingdee.pda.ui.one_click_return.ScanSnResultBean;
import com.kingdee.pda.ui.pick_goods.PickOrderBean;
import com.kingdee.pda.ui.scan_inwarehouse.ScanReceiveOrderBean;
import com.kingdee.pda.ui.scan_inwarehouse.ScanReceiveRequestBean;
import com.kingdee.pda.ui.sn_query_edit.ItemSNInfoVo;

import java.util.HashMap;
import java.util.List;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Url;

/**
 * Created by dlj
 * DATE 2021/7/15
 * TIME 15:20
 */
public interface Api {
    //无返回结果的请求
    @POST()
    Observable<BaseResponse> baseNoResultMethod(@Url String url, @Body Object map);

    //登录
    @POST()
    Observable<BaseResponse<LoginResponseBean>> login(@Url String url, @Body HashMap<String, Object> map);

    //查询pda配置信息
    @POST()
    Observable<BaseResponse<ConfigQueryResponceBean>> configQuery(@Url String url, @Body HashMap<String, Object> map);

    //校验库位
    @POST()
    Observable<BaseResponse<WarehouseLocation>> queryWarehouseLocation(@Url String url, @Body HashMap<String, Object> map);

    //校验sku
    @POST()
    Observable<BaseResponse<Goods>> queryGoods(@Url String url, @Body HashMap<String, Object> map);

    //查询商品对应的移入库位
    @POST()
    Observable<BaseResponse<SkuBindLocationsBean>> queryGoodsLocation(@Url String url, @Body HashMap<String, Object> map);

    //查询sku在库位下的库存
    @POST()
    Observable<BaseResponse<WarehouseLocation>> queryGoodsLocationStock(@Url String url, @Body HashMap<String, Object> map);

    //查询补货单列表
    @POST()
    Observable<BaseResponse<List<ReplenishOrderBean.DataBean>>> getRepleOrderList(@Url String url, @Body HashMap<String, Object> map);

    //查询盘点单接口
    @POST
    Observable<BaseResponse<List<CheckOrderListBean>>> getCheckOrderList(@Url String url, @Body HashMap<String, Object> map);

    //盘点单详情
    @POST
    Observable<BaseResponse<CheckOrderDetailBean>> getCheckOrderDetail(@Url String url, @Body HashMap<String, Object> map);
    // 库存状态
    @GET
    Observable<BaseResponse<List<InvstatusBean>>> getAllInvstatus(@Url String url);

    // 货主
    @POST
    Observable<BaseResponse<List<ProductOwnerBean>>> getProductOwner(@Url String url, @Body HashMap<String, Object> map);

    //查询补货单详情
    @POST()
    Observable<BaseResponse<ReplenishOrderDetailBean.DataBean>> getRepleOrderDetail(@Url String url, @Body HashMap<String, Object> map);

    //补货单提交
    @POST()
    Observable<BaseResponse> repleOrderCommit(@Url String url, @Body ReplenishCommitBean body);

    //查询仓库列表、组织列表
    @POST()
    Observable<BaseResponse<List<Warehouse>>> getWarehouseList(@Url String url, @Body HashMap<String, Object> map);

    //查询调拨单列表
    @POST()
    Observable<BaseResponse> getFastAllotOrderList(@Url String url, @Body HashMap<String, Object> map);

    //调拨单提交
    @POST()
    Observable<BaseResponse> fastallotOrderCommit(@Url String url, @Body FastAllotRequestBean body);

    //调拨单提交(任务)
    @POST()
    Observable<BaseResponse<BaseResponse>> fastallotTaskCommit(@Url String url, @Body FastAllotTaskResquestBean body);

    //查询仓库默认收货区
    @POST()
    Observable<BaseResponse<WarehouseAreaLocationInfo>> getDefaultLocationcode(@Url String url, @Body HashMap<String, Object> map);

    // 出库扫描单据
    @Headers("Content-Type:application/json;charset=utf-8")
    @POST()
    Observable<BaseResponse<ScanOutOrderInfoBean>> scanStockOutBillOrExpressNo(@Url String url, @Body HashMap<String, Object> map);

    // 出库扫描单据
    @Headers("Content-Type:application/json;charset=utf-8")
    @POST()
    Observable<BaseResponse<ScanSnResponsebean>> pdaScanSn(@Url String url, @Body HashMap<String, Object> map);

    //扫描出库提交
    @POST()
    Observable<BaseResponse> confirmStockOut(@Url String url, @Body HashMap<String, Object> map);

    //出库复核提交
    @POST()
    Observable<BaseResponse> confirmStockOutReview(@Url String url, @Body OutCheckRequestBean outCheckRequestBean);

    //提交库存盘点单
    @POST()
    Observable<BaseResponse> commitCheckOrder(@Url String url, @Body OrderSubmitBean submitBean);

    //扫描收货查询订单详情
    @POST()
    Observable<BaseResponse<ScanReceiveOrderBean>> scanReceiptQuery(@Url String url, @Body HashMap<String, Object> map);

    //扫描收货提交
    @POST()
    Observable<BaseResponse> confirmReceipt(@Url String url, @Body ScanReceiveRequestBean scanReceiveRequestBean);

    //一键退货扫描sn
    @POST()
    Observable<BaseResponse<ScanSnResultBean>> oneClickReturnScanSn(@Url String url, @Body HashMap<String, Object> map);

    //库位库存查询 sku列表
    @POST()
    Observable<BaseResponse<List<LocationBalanceRes>>> pda_location_stock_query(@Url String url, @Body HashMap<String, Object> map);

    //SN状态查询
    @POST()
    Observable<BaseResponse<List<ItemSNInfoVo>>> pdaQuerySnInfo(@Url String url, @Body HashMap<String, Object> map);

    //出库单拦截
    @POST()
    Observable<BaseResponse<List<InterceptionOrderBean>>> stockOutInterception(@Url String url, @Body HashMap<String, Object> map);

    //出库单拦截
    @POST()
    Observable<BaseResponse<PickOrderBean>> pickQuery(@Url String url, @Body HashMap<String, Object> map);

    // 权限校验
    @GET()
    Observable<BaseResponse<PriorityBean.Data>> checkPriority(@Url String url);
//    /**
//     * 以下为示范链接
//     * <p>
//     * TODO Get请求
//     */
//    //第一种方式：GET不带参数
//    @GET("retrofit.txt")
//    Observable<BaseResponse<BaseResponse>> getUser();
//
//    @GET
//    Observable<BaseResponse> getUser(@Url String url);
//
//    @GET
//    Observable<BaseResponse> getUser1(@Url String url); //简洁方式   直接获取所需数据
//
//    //第二种方式：GET带参数
//    @GET("api/data/{type}/{count}/{page}")
//    Observable<BaseResponse> getUser(@Path("type") String type, @Path("count") int count, @Path("page") int page);
//
//    //第三种方式：GET带请求参数：https://api.github.com/users/whatever?client_id=xxxx&client_secret=yyyy
//    @GET("users/whatever")
//    Observable<BaseResponse> getUser(@Query("client_id") String id, @Query("client_secret") String secret);
//
//    @GET("users/whatever")
//    Observable<BaseResponse> getUser(@QueryMap Map<String, String> info);
//
//    /**
//     * TODO POST请求
//     */
//    //第一种方式：@Body
//    @Headers("Accept:application/json")
//    @POST("login")
//    Observable<BaseResponse> postUser(@Body RequestBody body);
//
//    //第二种方式：@Field
//    @Headers("Accept:application/json")
//    @POST("auth/login")
//    @FormUrlEncoded
//    Observable<BaseResponse> postUser(@Field("username") String username, @Field("password") String password);
//
//    //多个参数
//    Observable<BaseResponse> postUser(@FieldMap Map<String, String> map);
//
//    /**
//     * TODO DELETE
//     */
//    @DELETE("member_follow_member/{id}")
//    Observable<BaseResponse> delete(@Header("Authorization") String auth, @Path("id") int id);
//
//    /**
//     * TODO PUT
//     */
//    @PUT("member")
//    Observable<BaseResponse> put(@HeaderMap Map<String, String> headers, @Query("nickname") String nickname);
//
//    /**
//     * TODO 文件上传
//     */
//    @Multipart
//    @POST("upload")
//    Observable<ResponseBody> upload(@Part("description") RequestBody description, @Part MultipartBody.Part file);
//
//    @Multipart
//    @POST("member/avatar")
//    Observable<BaseResponse> uploadImage(@HeaderMap Map<String, String> headers, @Part MultipartBody.Part file);
//
//    /**
//     * 多文件上传
//     */
//    @Multipart
//    @POST("register")
//    Observable<ResponseBody> upload(@PartMap Map<String, RequestBody> params, @Part("description") RequestBody description);
//    //Observable<ResponseBody> upload(@Part() List<MultipartBody.Part> parts);
//
//    @Multipart
//    @POST("member/avatar")
//    Observable<BaseResponse> uploadImage1(@HeaderMap Map<String, String> headers, @Part List<MultipartBody.Part> file);
//
//    /**
//     * @Streaming 这个注解必须添加，否则文件全部写入内存，文件过大会造成内存溢出
//     */
//    @Streaming
//    @GET
//    Observable<ResponseBody> download(@Header("RANGE") String start, @Url String url);
}
